//
//  String+LZ.swift
//  RouterDemo
//
//  Created by lizhi on 2022/2/25.
//
import Foundation

extension String {
    func toObject<T>(_ : T.Type) -> T? where T: Codable {
            guard let data = self.data(using: .utf8) else { return nil }
            return try? JSONDecoder().decode(T.self, from: data)
        }
}
